using System;
using System.Collections.Generic;
using System.Text;
using ACS.Runtime.Types;
using ACS.Runtime.Visitors;

namespace ACS.Runtime
{
    public class Module
    {
        protected static string i2s(int i)
        {
            return i.ToString();
        }

        protected static int s2i(string s)
        {
            try
            {
                return Int32.Parse(s);
            }
            catch (Exception)
            {
                return 0;
            }
        }

        public static void trace(IntType data)
        {
            new TraceVisitor().Visit(data);
        }

        public static void trace(StringType data)
        {
            new TraceVisitor().Visit(data);
        }

        public static void trace(BoolType data)
        {
            new TraceVisitor().Visit(data);
        }

        public static void trace(IArrayType data)
        {
            new TraceVisitor().Visit(data);
        }

        public static void trace(StructType data)
        {
            data.Accept(new TraceVisitor());
        }
    }
}
